package com.exceeddata.vcloud.business.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.exceeddata.vcloud.business.domain.dto.SchedulingJobInfoDto;
import com.exceeddata.vcloud.business.scheduling.QuartzSchedulingService;
import com.exceeddata.vcloud.common.response.Result;
import com.exceeddata.vcloud.common.response.ResultUtil;

import cn.hutool.core.lang.UUID;

@RestController
public class TestController {
	
	@Autowired
	private QuartzSchedulingService quartzSchedulingService;
	
    @GetMapping("test01")
    public Result test01(){
    	SchedulingJobInfoDto schedulingJobInfoDto = new SchedulingJobInfoDto();
    	schedulingJobInfoDto.setJobId(UUID.randomUUID().toString());
    	schedulingJobInfoDto.setCron("*/5 * * * * ?");
    	quartzSchedulingService.createSchedulingTaskJob(schedulingJobInfoDto);
    	return ResultUtil.success();
    }
}
